import request from '@/config/axios'

// 导师遴选批次 VO
export interface PickBatchVO {
  id: string // 主键
  batchName: string // 批次名称
  year: string // 年度
  applyStartTime: Date // 申请开始时间
  applyEndTime: Date // 申请结束时间
  reviewStartTime: Date // 评审开始时间
  reviewEndTime: Date // 评审结束时间
  applyCount: number // 申请人数
  reviewCount: number // 评审人数
  votedCount: number // 投票人数
  unVotedCount: number // 未投票人数
  applyTemplateUrl: string // 申请表模板地址
}

// 导师遴选批次 API
export const PickBatchApi = {
  // 查询导师遴选批次分页
  getPickBatchPage: async (params: any) => {
    return await request.get({ url: `/recruit/pick-batch/list`, params })
  },

  // 查询导师遴选批次详情
  getPickBatch: async (id: number) => {
    return await request.get({ url: `/recruit/pick-batch/get?id=` + id })
  },

  // 新增导师遴选批次
  createPickBatch: async (data: PickBatchVO) => {
    return await request.post({ url: `/recruit/pick-batch/create`, data })
  },

  // 修改导师遴选批次
  updatePickBatch: async (data: PickBatchVO) => {
    return await request.put({ url: `/recruit/pick-batch/update`, data })
  },

  // 删除导师遴选批次
  deletePickBatch: async (id: number) => {
    return await request.delete({ url: `/recruit/pick-batch/delete?id=` + id })
  },

  // 导出导师遴选批次 Excel
  exportPickBatch: async (params) => {
    return await request.download({ url: `/recruit/pick-batch/export-excel`, params })
  },

}
